prepare("select * from booking_table where id = $id") ;
$getdetails->execute() ;
$row = $getdetails->fetch(pdo::FETCH_ASSOC) ;
$bookingdate = $row['bk_date'] ;
$checkindate = $row['Ar_date'] ;
$checkoutdate = $row['Dp_date'] ;
$Room_category = $row['Room_category'] ;
$Room_no = $row['Room_no'] ;
$tcost = $row['T_cost'] ;
$customer = $row['customer'] ;
$cemail= $row['email'] ;
$phones= $row['phones'] ;
$idno= $row['id_no'] ;
$bkid= $row['booking_id'] ;
if($checkindate == $checkoutdate)
{
$nights = 1 ;
}
else
{
$start_datetime = new DateTime($checkindate);
$diff = $start_datetime->diff(new DateTime($checkoutdate));
$nights = $diff->days ;
}
//approved booking
if(isset($_POST['submit']))
{
$approve = $DBcon->prepare("update booking_table set confirm_status = 'Approved' where id = $id") ;
if($approve->execute()) header("location: maindashboard.php") ;
}
?>
Admin Panel